<?php

namespace App\Admin\Exports\Sheet;

use App\Models\Data\ClickLearn;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithTitle;

class ClickLearnSheet implements FromCollection, WithHeadings, WithTitle
{
    public function collection()
    {

        return ClickLearn::query()->select([
            'id', 'content', 'translation', 'phonetic', 'audio_url', 'image_url', 'sentence', 'sentence_translation',
            'type','is_download','is_recite','word_blanks','option','option_order','practice_translation'
        ])->get();
    }

    public function headings(): array
    {
        return  [
            '资源/内容编号', '内容', '翻译', '音标', '音频地址', '图片地址', '单词例句', '例句翻译','类型','是否下载',
            '是否背诵','下划线','选项','选项排序','文件名称'
        ];
    }

    public function title(): string
    {
        return '资源内容';
    }
}
